//package iterator;
//
//
//import tripleheap.*;
//import global.*;
//import bufmgr.*;
//import diskmgr.*;
//import labelheap.*;
//
//
//import java.lang.*;
//import java.io.*;
//
///**
// *open a heapfile and according to the condition expression to get
// *output file, call get_next to get all Labels
// */
//public class TripleFileScan extends  TripleIterator
//{
//	private TripleHeapfile tripleHeap;
//	private TScan scan;
//	
//	/**
//	 *constructor
//	 *@param file_name heapfile to be opened
//	 *@param in1[]  array showing what the attributes of the input fields are. 
//	 *@param s1_sizes[]  shows the length of the string fields.
//	 *@param len_in1  number of attributes in the input Label
//	 *@param n_out_flds  number of fields in the out Label
//	 *@param proj_list  shows what input fields go where in the output Label
//	 *@param outFilter  select expressions
//	 *@exception IOException some I/O fault
//	 *@exception FileScanException exception from this class
//	 *@exception LabelUtilsException exception from this class
//	 *@exception InvalidRelation invalid relation 
//	 */
//	public  TripleFileScan (String  file_name)
//			throws IOException,
//			FileScanException,
//			TripleUtilsException 
//			{
//			try {
//				tripleHeap = new TripleHeapfile(file_name);
//			}
//			catch(Exception e) {
//				throw new FileScanException(e, "Create new labelheapfile failed");
//			}
//
//			try {
//				scan = tripleHeap.openScan();
//			}
//			catch(Exception e){
//				throw new FileScanException(e, "openScan() failed");
//			}
//	}
//
//	/**
//	 *@return the result label
//	 *@exception JoinsException some join exception
//	 *@exception IOException I/O errors
//	 *@exception InvalidlabelSizeException invalid label size
//	 *@exception InvalidTypeException label type not valid
//	 *@exception PageNotReadException exception from lower layer
//	 *@exception PredEvalException exception from PredEval class
//	 *@exception UnknowAttrType attribute type unknown
//	 *@exception FieldNumberOutOfBoundException array out of bounds
//	 *@exception WrongPermat exception for wrong FldSpec argument
//	 */
//	public Triple get_next()
//			throws IOException,
//			InvalidTripleSizeException,
//			InvalidTypeException,
//			PageNotReadException
//			{     
//		
//		TID tid = new TID();
//		Triple t;
//		while(true) {
//			t =  scan.getNext(tid);
//			if(t == null) {
//				return null;
//			}     
//			else
//			{
//				return t;
//			}
//			
//		}
//	}
//
//	/**
//	 *implement the abstract method close() from super class Iterator
//	 *to finish cleaning up
//	 */
//	public void close() 
//	{
//
//		if (!closeFlag) {
//			scan.closescan();
//			closeFlag = true;
//		} 
//	}
//
//}
//

